<template>
	<view class="lay-root">
		<view class="table-lay">
			<scroll-view scroll-y="true" scroll-x="true" class="scroll-view">
				<view class="table-head flex-h">
					<view v-for="(item,index) in headData" :key="index" 
						v-if="item.showType.indexOf(showType) >= 0"
						class="head-item" 
						:style="'width:' + (item.widthRito) + '; border-right:' 
							+ (item.borderRight ? '1' : '0') + 'upx solid #fff' ">
						{{item.name}}
					</view>
				</view>
				<view class="content-item">
					
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			infoData: {
				type: Object
			},
		},

		components: {},

		data() {
			return {
				headData:[],
				contentData: [],
				showType: "0"
			}
		},

		mounted() {
			this.headData = this.infoData.headData;
			
			for(let i = 0 ; i < 20; i++) {
				this.contentData.push(this.infoData.contentData[0])
			}
			// this.headData = this.infoData.contentData;
		},
		
		computed:{
			checkTableShowColum(inType) {
				if(inType.indexOf(this.showType) == -1)
					return true;
				return false;
			}
		},

		methods: {
			onSecondClick() {
				this.secondShowType++;
				if(this.secondShowType > 1)
					this.secondShowType = 0 ;
			}
		}
	}
</script>

<style scoped lang="scss">
	.lay-root {
		padding: 15upx;
		background-color: #fff;
	}

	.scroll-view {
		white-space: nowrap;
		width: 100%;
	}

	.table-head {
		.head-item {
			display: float;
			font-size: 18upx;
			font-weight: bold;
			color: #1F2329;
			padding: 10upx 15upx;
			background: #E9E9E9;
			// border: 1upx solid #fff;
			box-shadow: 0px 1px 0px 0px #E8E8E8;
		}
	}
	
	.charts-box {
		width: 100%;
		height: 300px;
	}
</style>
